<?php

namespace App\Model;

use Hyperf\DbConnection\Model\Model;

/**
 * 用户提醒黑名单
 */
class UserExcludeTip extends Model
{
    protected $table = 'user_exclude_tip';
    protected $fillable = ['user_id', 'flag'];

    static function getList()
    {
        return self::where('flag', 1)->pluck('user_id')->toArray();
    }

    /**
     * 是否被排除提醒
     */
    static function checkExclude($userId = 0)
    {
        return in_array($userId, self::getList());
    }
}
